const express = require('express')
const router = express.Router()
const BlogRoll = require('../model/blogRoll')
const Blog = require('../model/blog')


router.get("/total/count",async (req,res)=>{
    const blogCount = await Blog.count()
    const rollCount = await BlogRoll.count()
    if(blogCount && rollCount){
        return res.send({
            code:1,
            msg:"查询成功",
            data:{
                blogCount,
                rollCount
            }
        })
    }else{
        return res.send({
            code:-1,
            msg:"查询失败",
            data:{
                blogCount:0,
                rollCount:0
            }
        })
    }
})

module.exports = router